Clean up and enhance "make tags"
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Sat, 23 Sep 2006 13:07:30 +0000 (14:07 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Sat, 23 Sep 2006 13:07:30 +0000 (14:07 +0100)
- delete correct file in _tags rule
- don't prune nonexistent files/dirs
- call exuberant-ctags with additional flags from Linux:
    -I to ignore some misleading hits
    --extra=+f to include an entry for the basename of every file
    --c-kinds=+px to add prototypes and external variable declarations

Signed-off-by: Aron Griffis <aron@hp.com>
xen/Makefile

index 6f6d888e70445be9dd594ba12ecc179f4fd25694..4485a8e93147b4e03373b621ca83cc3b21e707f0 100644 (file)
@@ -123,19 +123,29 @@ include/asm-$(TARGET_ARCH)/asm-offsets.h: arch/$(TARGET_ARCH)/asm-offsets.s
 
 SUBDIRS = acm arch/$(TARGET_ARCH) common drivers 
 define all_sources
-    ( find include/asm-$(TARGET_ARCH) -name SCCS -prune -o -name '*.h' -print; \
-      find include -type d -name SCCS -prune -o \( -name "asm-*" -o \
-            -name config \) -prune -o -name '*.h' -print; \
-      find $(SUBDIRS) -name SCCS -prune -o -name '*.[chS]' -print )
+    ( find include/asm-$(TARGET_ARCH) -name '*.h' -print; \
+      find include -name 'asm-*' -prune -o -name '*.h' -print; \
+      find $(SUBDIRS) -name '*.[chS]' -print )
+endef
+
+define set_exuberant_flags
+    exuberant_flags=`$1 --version 2>/dev/null | grep -iq exuberant && \
+       echo "-I __initdata,__exitdata,__acquires,__releases \
+           -I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \
+           --extra=+f --c-kinds=+px"`
 endef
 
 .PHONY: _TAGS
 _TAGS: 
-       rm -f TAGS && $(all_sources) | xargs etags -a
+       rm -f TAGS; \
+       $(call set_exuberant_flags,etags); \
+       $(all_sources) | xargs etags $$exuberant_flags -a
 
 .PHONY: _tags
 _tags: 
-       rm -f TAGS && $(all_sources) | xargs ctags -a
+       rm -f tags; \
+       $(call set_exuberant_flags,ctags); \
+       $(all_sources) | xargs ctags $$exuberant_flags -a
 
 .PHONY: _cscope
 _cscope: